package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._1工厂模式._计算器3;

import java.util.Scanner;

/**
 * @ClassName Test
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/9 8:10 PM
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        try {
            Scanner sc = new Scanner(System.in);

            System.out.println("请输入数字A：");
            double numberA = Double.parseDouble(sc.nextLine());
            System.out.println("请选择运算符号(+、-、*、/)：");
            String strOperate = sc.nextLine();
            System.out.println("请输入数字B：");
            double numberB = Double.parseDouble(sc.nextLine());

            double result = Operation.getResult(numberA,numberB,strOperate);

            System.out.println("结果是："+result);
        }
        catch(Exception e){
            System.out.println("您的输入有错："+e.toString());
        }
    }
}
